﻿Public Class SidePanel
    Public Event CancelButtonClickEvent()
    Public Event FindButtonClickEvent()
    Public Event SaveButtonClickEvent()
    Public Event PrintButtonClickEvent()
    Public Event AddButtonClickEvent()
    Public Event BackButtonClickEvent()

    Private Sub CancelButton_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles CancelButton.Click
        RaiseEvent CancelButtonClickEvent()
    End Sub

    Private Sub FindButton_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles FindButton.Click
        RaiseEvent FindButtonClickEvent()
    End Sub

    Private Sub PrintButton_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles PrintButton.Click
        RaiseEvent PrintButtonClickEvent()
    End Sub

    Private Sub SaveButton_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles SaveButton.Click
        RaiseEvent SaveButtonClickEvent()
    End Sub

    Public WriteOnly Property SaveVisibility As Boolean
        Set(ByVal value As Boolean)
            SaveButton.Visibility = value
        End Set
    End Property

    Public WriteOnly Property FindVisibility As Boolean
        Set(ByVal value As Boolean)
            FindButton.Visibility = value
        End Set
    End Property

    Public WriteOnly Property PrintVisibility As Boolean
        Set(ByVal value As Boolean)
            PrintButton.Visibility = value
        End Set
    End Property

    Public WriteOnly Property AddVisibility As Boolean
        Set(ByVal value As Boolean)
            AddButton.Visibility = value
        End Set
    End Property

    Public WriteOnly Property BackVisibility As Boolean
        Set(ByVal value As Boolean)
            BackButton.Visibility = value
        End Set
    End Property

    Private Sub AddButton_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles AddButton.Click
        RaiseEvent AddButtonClickEvent()
    End Sub

    Private Sub BackButton_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles BackButton.Click
        RaiseEvent BackButtonClickEvent()
    End Sub
End Class
